{smcl}
{* *! version 1 14Dec2020}{...}
{cmd:help for imusic}
{hline}

{title:Title}

    imusic - find music while working on Stata

{title:Require}

{pstd}To use this command, you will need to have installed sxpose and jsonio, which is available from ssc via the following link

{pstd}{stata ssc install sxpose}{p_end}
{pstd}{stata ssc install jsonio}{p_end}


{title:Syntax}

{pstd}syntax [anything(name=name)][, Platform(string)] [BRowse] [Stop] [Kind(string)] [Link] [Nl] [List(string)] [Markdown] [Autoplay] [NDescription]
	
{title:Description}

{pstd}imusic--you can search what you would like to listen and play it online or locally in Stata without affecting your work.

{title:Options}

{synoptset 20 tabbed}{...}
{synopthdr}
{synoptline}
{syntab:{it:Optionals}...}

{synopt:{opt  plat:form(string)}}Specify music platform (t/T for Tencent, n/N for Netease, l/L for local); default is Netease.{p_end}
{p 26 4 2}if platform=l(/L), will need to global songpath.{p_end}
			
{synopt:{opt  br:owse}}Open the link directly in your web browser,when platform!=l(/L){p_end}

{synopt:{opt  s:top}}Stop the music if platform=l(/L), only for Windows(groove.exe or QQMusic.exe){p_end}

{synopt:{opt  k:ind}}Specify which type you're searching, default is single.{p_end}
{p 26 4 2}single=1; album=10; songlist=1000; Radio=1009; MV=1014{p_end}
{p 26 4 2}MV is not available for Netease; songlist & radio is not available for Tencent{p_end}

{synopt:{opt  l:ink}}Show link.{p_end}

{synopt:{opt  n:l}}Do not show lyrics.{p_end}

{synopt:{opt  l:ist(string)}}The numble of search results been display. Default is 1.{p_end}

{synopt:{opt  m:arkdown}}Show link in markdown format.{p_end}

{synopt:{opt  a:utoplay}}Browse a website that can autoplay music.{p_end}
{p 26 4 2}Isn't available when search non-single on Tencent{p_end}

{synopt:{opt  nd:escription}}Do not show description.{p_end}
					
{synoptline}
{p2colreset}{...}										
					
{title:Examples}

. imusic , l m l(2)
{browse "https://music.163.com/#/song?id=1804289377" : https://music.163.com/#/song?id=1804289377}
{browse "https://music.163.com/#/song?id=1804289377" :  <<Starbucks, Me and You>>, by 平井 大}
[Starbucks, Me and You](https://music.163.com/#/song?id=1804289377)

{browse "https://music.163.com/#/song?id=1804846696" : https://music.163.com/#/song?id=1804846696}
{browse "https://music.163.com/#/song?id=1804846696" :  <<风眠>>, by 苏紫旭&The Paramecia}
[风眠](https://music.163.com/#/song?id=1804846696)
  

. imusic 起风了, p(t) l(2) l k(10)
{browse "https://y.qq.com/n/yqq/album/003j3NMw1ZBpsv.html" : https://y.qq.com/n/yqq/album/003j3NMw1ZBpsv.html}
{browse "https://y.qq.com/n/yqq/album/003j3NMw1ZBpsv.html" :  <<起风了>>, by 买辣椒也用券}

{browse "https://y.qq.com/n/yqq/album/000CVCqK4aEW0M.html" : https://y.qq.com/n/yqq/album/000CVCqK4aEW0M.html}
{browse "https://y.qq.com/n/yqq/album/000CVCqK4aEW0M.html" :  <<起风了>>, by 周深}



. imusic 所念皆星河
 
所念皆星河 辗转里反侧
你占领每个 永恒的片刻
无垠的宇宙 浩瀚的选择
你是最亮那颗
所爱如月色 触手而不得
将温柔的梦 都投射
你眼里有我 对这世间的
吝啬
{browse "https://music.163.com/#/song?id=1476239407" :  <<所念皆星河>>, by 房东的猫}
  
. imusic 所念皆星河, nl
{browse "https://music.163.com/#/song?id=1476239407" :  <<所念皆星河>>, by 房东的猫}

 

. imusic 纯音乐, kind(1000)
 {browse "https://music.163.com/#/playlist?id=3080165816" :  <<【纯音乐】温柔治愈系纯音乐>>, by 你今天真真真好看}
所念皆星河，所爱隔山海。
星河不可及，山海不可平。


. imusic 纯音乐, kind(1000) nd
 {browse "https://music.163.com/#/playlist?id=3080165816" :  <<【纯音乐】温柔治愈系纯音乐>>, by 你今天真真真好看}

 
{title:Shortcoming}

{pstd}platform(l) is not available when Mac system or default music player is Netease.{p_end}
{pstd}It'll take some time when you want to listen to a random song.{p_end}

{title:Install & Uninstall}
	
{pstd}To install this command, it is recommended to download the file from {browse "https://gitee.com/arlionn/mymusic" :  https://gitee.com/arlionn/mymusic} and install it from local.{p_end}
{pstd}{stata net install imusic, from() }{p_end}

{pstd}To uninstall, you can use{p_end}
{pstd}{stata ado uninstall imusic }{p_end}



